package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author yzq
 * @Description 订单库存记录
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_prescription_drug_comfire")
public class OrderComfire implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "处方详情id")
    private Long infoDrugId;
    @ApiModelProperty(value = "个数")
    private Integer diveNum;
    @ApiModelProperty(value = "入库详情id")
    private Long warehousingId;
    @ApiModelProperty(value = "剩余个数")
    private Integer plusNum;
    @ApiModelProperty(value = "单位")
    private String useUnit;
    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;


    public void copy(OrderComfire source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
